/**
 * 
 */
package com.study.strategy;

import java.io.Console;

/**
 * 
 * 策略模式可以理解为老司机开车，但是他今天想到路虎，明天想开奔驰
 * @author Administrator
 * @date 2019年5月7日
 */
public class StrategyTest {

	public static void main(String[] args) {
		Car luhu = new Car("红色","路虎");
		Car byd = new Car("白色","比亚迪");

		Person person1 = new Person("xiaoming", luhu);
		Person person2 = new Person("xiaoming2", byd);
		byd.setName(byd.getName() + "加强版");
		person1.drive();
		person2.drive();
		
		person1.drive(byd);
		person2.drive(luhu);
	}

	
	
}
